package com.it.zhangjun.design.pattern.chainOfResponsibility;

/**
 * @className: FullDiscountFilter
 * @description: 满200减20元
 * @author: z00018123
 * @date: 2021/4/29
 **/
public class FullDiscountFilter extends DiscountFilter {
    @Override
    protected int calculatePrice(int price) {
        if (price > 200) {
            System.out.println("优惠满减20元");
            price = price - 20;
        }
        if (this.nextDiscountFilter != null) {
            return this.nextDiscountFilter.calculatePrice(price);
        }
        return price;
    }
}
